# -*- coding:utf-8 -*-

from rest_framework import serializers
from ..models.project import Project
from Apps.user.ser.userSer import UserSer


class ProjectSer(serializers.ModelSerializer):
    # creator = serializers.CharField()
    # modifier = serializers.CharField()

    creator = UserSer()
    modifier = UserSer()

    class Meta:
        model = Project
        fields = ["id", "project_name", "project_type", "project_url", "project_version", "project_tags",
                  "project_description",
                  "creator", "modifier", "create_time", "update_time"]


class createProjectSer(serializers.ModelSerializer):
    # creator = UserSer()
    # modifier = UserSer()

    class Meta:
        model = Project
        fields = '__all__'


class patchProjectSer(serializers.ModelSerializer):
    # modifier = UserSer()

    class Meta:
        model = Project
        fields = '__all__'


class ProjectSelectListSer(serializers.ModelSerializer):

    class Meta:
        model = Project
        fields = ["id", "project_name"]

